package ThreeSixZero;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;

/**
 * @author le
 */
public class Test01
{
    static List<Integer> list = new ArrayList<>();
    
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] arr = new int[n];
        int[] used = new int[n];
        int one = 0;
        int two = 0;
        int three = 0;
        for (int i = 0; i < n; i++)
        {
            arr[i] = in.nextInt();
            two += arr[i];
        }
        for (int i = 0;i < n-1;i++){
            for (int j = i+1;j < n;j++){
             System.out.println(arr[i]+"  "+arr[j]);
             three += (arr[i]|arr[j]);
            }
        }

        in.close();
        System.out.println(three+two);
        System.out.println(2|3);
    }

}
